# -*- coding: utf-8 -*-
# @Time : 2025/2/27 15:59
# @Author : debbyszhang
# @File : disable_user.py
# @desc :
import allure
from playwright.sync_api import expect

from libs.tools import utils
from pageObject.user_list_page import UserListPage


@allure.feature("禁用启用用户")
class TestDisableUser:

    def test_disable_user(self, page):
        user_list_page = UserListPage(page)
        username = 'cross'
        row_number = 1
        user_list_page.disable_user(row_number=row_number)
        t = user_list_page.page.locator("#tea-message-root div").inner_text()
        print(t)  # '操作成功'
        user_list_page.disable_user(row_number=row_number)
        t = user_list_page.page.locator("#tea-message-root div").inner_text()
        print(t)  # '操作成功'
        operation = user_list_page.page.get_by_role("row", name=username).get_by_role("button").first.text_content()
        print(operation)
        assert operation == '禁用'
